package com.droidwatcher.JsonEntity;

import android.content.SharedPreferences;
import android.content.pm.PackageManager;

import com.droidwatcher.MyApplication;
import com.droidwatcher.SettingsManager;

/**
 * Created by Administrator on 2018/1/24.
 */

public class HttpRequestHead {
    long uid;
    String token;
    int client_type;
    String client_id;
    int version;

    SettingsManager settingsManager = new SettingsManager(MyApplication.app);

    public HttpRequestHead() {
        init();
    }

    private void init() {
        SharedPreferences share = settingsManager.getSettings();
        client_id = settingsManager.imei();
        uid = share.getLong("uid",0);
        token = share.getString("token","");
        client_type = 2 ;

        try {
            version = MyApplication.app.getPackageManager().getPackageInfo(MyApplication.app.getPackageName(),0).versionCode;
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
    }

    public long getUid() {
        return uid;
    }

    public void setUid(int uid) {
        this.uid = uid;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public int getClient_type() {
        return client_type;
    }

    public void setClient_type(int client_type) {
        this.client_type = client_type;
    }

    public String getClient_id() {
        return client_id;
    }

    public void setClient_id(String client_id) {
        this.client_id = client_id;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }



}
